<template>
  <!--投诉公示-->
  <div class="container">
    <div class="header">
      <loginHeader
        :isShowType="isShowType"
        :activeIndex="activeIndex"
        :isShowToHome="true"
      ></loginHeader>
    </div>
    <div class="main">
      <div class="bannerbox">
        <div class="banner">
          <img src="../../../static/img/common/complaintBanner.png" />
        </div>
        <div class="banner-title"></div>
      </div>
      <div class="content">
        <div class="table-c">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr class="title">
              <td>地区</td>
              <td>联系部门</td>
              <td>联系电话</td>
              <td>联系邮箱</td>
              <td>联系地址</td>
            </tr>
            <tr
              v-for="(item, index) of this.$store.state.areaInfoArr
                .complaintChannelList"
              :key="index"
            >
              <td>{{ item.areaName }}</td>
              <td>{{ item.department }}</td>
              <td>{{ item.tel }}</td>
              <td>{{ item.email }}</td>
              <td>{{ item.address }}</td>
            </tr>
          </table>
        </div>
      </div>
      <div class="noPayCode" v-if="isEsUser()">
        <p class="titles">您还可以扫码二维码填写投诉申请</p>
        <img :src="nopayCodes" alt="恩施欠薪投诉二维码" />
        <el-link type="primary" @click="downLoadCode" icon="el-icon-download"
          >点击下载二维码</el-link
        >
      </div>
      <div class="nopayCode" v-if="isEsUser()">
        <div class="titles">您还可以扫码二维码填写投诉申请</div>
        <img :src="nopayCodes" alt="" />
        <el-link icon="el-icon-download" @click="downloadCode" type="primary"
          >点击下载二维码</el-link
        >
      </div>
    </div>
    <loginFooter></loginFooter>
  </div>
</template>

<script>
import loginHeader from '@/components/publicCom/loginHeader'
import loginFooter from '@/components/publicCom/loginFooter'
export default {
  name: 'complaintPublicity',
  components: {
    loginHeader,
    loginFooter,
  },
  data() {
    return {
      isShowType: false,
      activeIndex: '2',
      qrCode_Url1: '',
      qrCode_Url2: '',
      version1: '',
      version2: '',
      nopayCodes: '', //恩施需求
    }
  },
  created() {
    this.getQRcode1()
    this.getQRcode2()
    if (this.isEsUser()) {
      this.getNopayCode()
    }
  },
  methods: {
    goBackList() {
      this.$router.push('/login/loginFirst')
      this.$store.commit('GOBACK_NAME', {
        oldUrl: '/login/loginFirst',
        newUrl: this.$router.currentRoute.fullPath,
      })
    },
    getQRcode1() {
      this.axios({
        method: 'post',
        url: 'api-bs/upgrade/check',
        data: {
          enName: 'gj365_nc',
        },
      })
        .then(
          (response) => {
            this.qrCode_Url1 = response.data.qrCode_Url
            this.version1 = response.data.version
          },
          (response) => {}
        )
        .catch((error) => {})
    },
    getQRcode2() {
      this.axios({
        method: 'post',
        url: 'api-bs/upgrade/check',
        data: {
          enName: 'gj365_cs',
        },
      })
        .then(
          (response) => {
            this.qrCode_Url2 = response.data.qrCode_Url
            this.version2 = response.data.version
          },
          (response) => {}
        )
        .catch((error) => {})
    },
    getNopayCode() {
      this.axios.post('api-f/files/back_pay/qr').then((res) => {
        if (!res.data.hasError) {
          this.nopayCodes = res.data.result.url
        }
      })
    },
    downloadCode() {
      window.open(this.nopayCodes)
    },
  },
}
</script>

<style scoped>
.nopayCode {
  position: absolute;
  top: 320px;
  right: 130px;
  width: 300px;
  height: 300px;
  text-align: center;
}
.nopayCode .titles {
  font-size: 14px;
  color: #409eff;
}
.nopayCode img {
  display: block;
  width: 160px;
  height: 180px;
  margin: 30px auto;
}
.header {
  position: absolute;
  top: 0;
  width: 100%;
  background: #08205c;
  background: linear-gradient(
    left,
    #08205c 0%,
    #0f4d9a 10%,
    #0f4d9a 90%,
    #08205c 100%
  );
  height: 64px;
}

.bannerbox {
  width: 100%;
  position: relative;
  overflow: hidden;
  height: 240px;
}

.banner {
  width: 1920px; /*图片宽度*/
  position: absolute;
  left: 50%;
  margin-left: -960px; /*图片宽度的一半*/
  z-index: 10;
}
.banner-title {
  width: 518px;
  position: absolute;
  left: 50%;
  margin-left: -259px;
  top: 50%;
  margin-top: -27px;
  z-index: 20;
}

.main {
  width: 100%;
  overflow: auto;
  top: 64px;
  position: absolute;
  z-index: 10;
  /* bottom: 94px; */
  bottom: 0px;
}

.content {
  margin: 0 auto;
  position: relative;
  width: 900px;
  padding-bottom: 50px;
}
.noPayCode {
  text-align: center;
  position: absolute;
  top: 320px;
  right: 130px;
  width: 250px;
  height: 300px;
  /* border: 1px solid red; */
}
.noPayCode .titles {
  font-size: 14px;
  background-color: none;
  color: #409eff;
}
.noPayCode img {
  display: block;
  width: 160px;
  height: 180px;
  margin: 30px auto;
}
.noPayCode .el-link {
}
.container .footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 64px;
  line-height: 64px;
  background-color: #3e3e4a;
  text-align: center;
  color: #ffffff;
  margin-top: 50px;
  font-size: 14px;
  margin-bottom: 0;
  z-index: 9999;
}
.table-c table {
  border-right: 1px solid #cdcdcd;
  border-bottom: 1px solid #cdcdcd;
  margin: 60px auto;
}

.table-c table td {
  border-left: 1px solid #cdcdcd;
  border-top: 1px solid #cdcdcd;
  text-align: center;
  color: #486d91;
  padding: 10px;
  /* min-height: 40px; */
}

.title {
  background-color: #deeff9;
}

.title td {
  padding: 0 10px;
  min-width: 135px;
}

.evm-box {
  display: inline-block;
  width: 240px;
  text-align: center;
}
.evm-img {
  width: 130px;
  height: 130px;
  margin-top: 20px;
}
.evm-t {
  display: block;
  font-weight: bold;
  font-size: 18px;
  text-align: center;
  width: 240px;
  margin-top: 10px;
}
.evm-v {
  display: block;
  font-size: 14px;
  color: #999999;
  text-align: center;
  width: 240px;
}
</style>
